#ifndef __MODELEDITOR_MAINMENU_H
#define __MODELEDITOR_MAINMENU_H

#include "../../JuceLibraryCode/JuceHeader.h"

class MainAppWindow;
class ModelEditorMainFrame;

class MainMenuComponent  :	public Component,
							public MenuBarModel,
							public ChangeListener,
							public ApplicationCommandTarget
{
public:
    //==============================================================================
    MainMenuComponent(ApplicationCommandManager* pCommandManager)
        : m_pCommandManager(pCommandManager)
    {
		setApplicationCommandManagerToWatch(pCommandManager);
    }

    ~MainMenuComponent()
    {
    }

	void SetParent(MainAppWindow* pAppWin) { m_pMainAppWindow = pAppWin; }
	ModelEditorMainFrame* GetMainFrame();

    //==============================================================================

	void changeListenerCallback(ChangeBroadcaster*)
	{
		menuItemsChanged();
	}


    //==============================================================================
    StringArray getMenuBarNames();
    PopupMenu getMenuForIndex(int topLevelMenuIndex, const String& menuName);
    void menuItemSelected(int menuItemID, int topLevelMenuIndex);

    //==============================================================================
    ApplicationCommandTarget* getNextCommandTarget();
    void getAllCommands(Array <CommandID>& commands);
    void getCommandInfo(CommandID commandID, ApplicationCommandInfo& result);
    //bool isCommandActive(const CommandID commandID);
    bool perform(const InvocationInfo& info);


private:
	ApplicationCommandManager*	m_pCommandManager;
	MainAppWindow*				m_pMainAppWindow;
	TooltipWindow				m_TooltipWindow;
};

#endif